CC=gcc
CFLAGS=-Os -g -Wall -Wpedantic -fpack-struct -std=c99 -I../../include/
BUILD=build
OBJECTS=main.o cc2420.o
 
all: runtest

$(BUILD)/%.o: %.c | $(BUILD)
	$(CC) $(CFLAGS) -c -o $@ $<

$(BUILD):
	mkdir -p $@

runtest: $(foreach obj, $(OBJECTS), $(BUILD)/$(obj))
	$(CC) $(CFLAGS) -o runtest $^

clean:
	rm -R build
